<?php

class OptionsController extends Controller {

    public $layout = '/layouts/main';

    public function actionIndex() {
        
        $model = new OptionsForm();

        if (isset($_POST['OptionsForm'])) {
            $filePath = Yii::app()->basePath . '/config/params.php';
            @file_put_contents($filePath, '<?php return ' . var_export($_POST['OptionsForm'], true) . ';');
            $this->redirect(array('index'));
        }

        $this->render('index', array(
            'model' => $model
        ));
    }

}
